package com.star.caffeine.controller;


import com.star.caffeine.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description: 控制器
 * @author: star
 * @create: 2025-04-23 17:10
 **/
@RestController
@RequestMapping("/cache")
public class TestController {

    @Autowired
    private TestService testService;

    @RequestMapping("/get")
    public String get(String key) {
        return testService.get(key);
    }


    @PutMapping("/setCache")
    public String setCache(String key, String value) {
        return testService.setCache(key, value);
    }

    @GetMapping("/getRefresh")
    public String getRefresh(String key) {
        return testService.getRefresh(key);
    }
}
